﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace bai_2_03_So_thich
{
    public partial class SoThich : Form
    {
        public SoThich()
        {
            InitializeComponent();
        }

        private void btnchon_Click(object sender, EventArgs e)
        {
            string kq = "";
            string kq2 = "";
            foreach (Control kt in groupBox1.Controls)
                if (kt is CheckBox)
                    if (((CheckBox)kt).Checked == true)
                    {
                        kq += kt.Text + ",";
                    }
            foreach (Control kt2 in groupBox2.Controls)
                if (kt2 is RadioButton)
                    if (((RadioButton)kt2).Checked == true)
                    {
                        kq2 += kt2.Text;
                    }
            MessageBox.Show("Sở thích của bạn: " + kq + "\n" + "Màu sắc yêu thích là: " + kq2);
        }
    }
}
